diff options
Diffstat (limited to 'src/pages/api/auth/[...nextauth].js')
| -rw-r--r-- | src/pages/api/auth/[...nextauth].js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pages/api/auth/[...nextauth].js b/src/pages/api/auth/[...nextauth].js index 3c433167..c188aaa1 100644 --- a/src/pages/api/auth/[...nextauth].js +++ b/src/pages/api/auth/[...nextauth].js @@ -20,7 +20,11 @@ export default NextAuth({ session.accessToken = token.accessToken return session - } + }, + async redirect({ url, baseUrl }) { + // Redirect to dashboard after login + return url.startsWith(baseUrl) ? url : baseUrl; + }, }, secret: process.env.JWT_SECRET }) |
